From a68cc879d995f46839e794a9aaeca81ba92f9888 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 28 Feb 2006 10:12:29 +0100 Subject: [PATCH] Fix SVM vlapic logic. Signed-off-by: Tom Woller --- xen/arch/x86/hvm/svm/intr.c | 16 +++++++--------- xen/arch/x86/hvm/svm/svm.c | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index 9ddaacee7a..33f1c42c06 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -80,12 +80,7 @@ interrupt_post_injection(struct vcpu * v, int vector, int type) { struct hvm_virpit *vpit = &(v->domain->arch.hvm_domain.vpit); - switch(type) - { - case VLAPIC_DELIV_MODE_EXT: - case VLAPIC_DELIV_MODE_FIXED: - case VLAPIC_DELIV_MODE_LPRI: - if ( is_pit_irq(v, vector, type) ) { + if ( is_pit_irq(v, vector, type) ) { if ( !vpit->first_injected ) { vpit->first_injected = 1; vpit->pending_intr_nr = 0; @@ -95,12 +90,15 @@ interrupt_post_injection(struct vcpu * v, int vector, int type) } vpit->inject_point = NOW(); svm_set_tsc_shift (v, vpit); - } + } + + switch(type) + { + case VLAPIC_DELIV_MODE_EXT: break; default: - printk("Not support interrupt type: %d\n", type); - break; + vlapic_post_injection(v, vector, type); } } diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index e4d1c6bf09..45dcaf28a1 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -810,7 +810,8 @@ void svm_relinquish_resources(struct vcpu *v) vpit = &v->domain->arch.hvm_domain.vpit; kill_timer(&vpit->pit_timer); kill_timer(&v->arch.hvm_svm.hlt_timer); - if ( hvm_apic_support(v->domain) ) { + if ( hvm_apic_support(v->domain) && (VLAPIC(v) != NULL) ) + { kill_timer( &(VLAPIC(v)->vlapic_timer) ); xfree( VLAPIC(v) ); } -- 2.30.2